import request from '@/router/axios';

export const getTree = () => {
    return request({
        url: '/api/manager-api/mx-type-expansion/list',
        method: 'get',
    })
}

export const getTable = (params) => {
    return request({
        url: '/api/manager-api/mx-type-expansion/detail',
        method: 'get',
        params: params
    })
}

export const save = (data) => {
    return request({
        url: '/api/manager-api/mx-type-expansion/insert',
        method: 'post',
        data: data
    })
}

export const update = (data) => {
    return request({
        url: '/api/manager-api/mx-type-expansion/update',
        method: 'post',
        data: data
    })
}

/**
 * @param params 详情
 * */
export const detail = (params) => {
    return request({
        url: '/api/manager-api/mx-type-expansion/detail',
        method: 'get',
        params
    })
}

/**
 * @param params 检出
 * */
export const checkout = (params) => {
    return request({
        url: '/api/manager-api/mx-type-expansion/checkout',
        method: 'post',
        params
    })
}

/**
 * @param params 检入
 * */
export const checkin = (params) => {
    return request({
        url: '/api/manager-api/mx-type-expansion/checkin',
        method: 'post',
        params
    })
}

/**
 * @param params 撤销检出
 * */
export const unCheckOut = (params) => {
    return request({
        url: '/api/manager-api/mx-type-expansion/revokeCheckout',
        method: 'post',
        params
    })
}

/**
 * @param params 删除
 * */
export const del = (params) => {
    return request({
        url: '/api/manager-api/mx-type-expansion/delete',
        method: 'post',
        params
    })
}

/**
 * @param data 添加布局
 * */
export const insertLayout = (data) => {
    return request({
        url: '/api/manager-api/mx-type-layout/insert',
        method: 'post',
        data
    })
}
/**
 * @param data 编辑布局
 * */
export const updateLayout = (data) => {
    return request({
        url: '/api/manager-api/mx-type-layout/update',
        method: 'post',
        data
    })
}

/**
 * @param params 编辑布局
 * */
export const layoutDetail = (params) => {
    return request({
        url: '/api/manager-api/mx-type-layout/detail',
        method: 'get',
        params
    })
}
